package com.banyuan.controller;

import com.banyuan.domain.User;
import com.banyuan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author yzt
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/list")
    @ResponseBody
    public List<User> list() {
        List<User> all = userMapper.findAll();
        return all;
    }
}
